from evolution.black_tablut_agent_evolution import TablutContest
from juegos.black_tablut_agent import BlackTablutAgent
from juegos.tablut import Board, Tablut
#board = Board({(5, 4): 1, (8, 2): 0, (4, 8): 1, (3, 2): 1, (0, 7): 1, (0, 5): 1, (0, 3): 1, (8, 5): 1, (5, 8): 1, (5, 3): 0, (8, 3): 1, (5, 5): 0, (6, 3): 0, (0, 6): 2, (5, 0): 1, (0, 4): 1, (4, 3): 0, (3, 5): 0, (3, 4): 0, (0, 2): 0},Tablut.BLACK_COUNTER)
#game = Tablut(board)

#agent = BlackTablutAgent()

'''game.state.current_player = Tablut.BLACK_PLAYER
king_pos = [key for key in game.state.pieces.keys() if game.state.pieces[key] == Tablut.WHITE_KING][0]
res = agent._wrap(game, king_pos)
print res
'''
contest = TablutContest(Tablut(),[20,10,5,30])
for res in contest.run():
    pass
stats = contest.stats
print stats